<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="mall/advert/include::header"></head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/css/bootstrap-select.min.css">
<link rel="stylesheet" type="text/css" href="/css/plugins/layui/layui.css"/>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>添加</h5>
					</div>
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
							<div class="form-group">
								<label class="col-sm-3 control-label">标题:</label>
								<div class="col-sm-8">
									<input id="name" name="name" class="form-control" type="text">
								</div>
							</div>
							
                         <div class="form-group">
								<label class="col-sm-3 control-label">排序:</label>
								<div class="col-sm-8">
									<input id="displayorder" name="displayorder" class="form-control" type="number">
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-3 control-label">支付价格:</label>
								<div class="col-sm-8">
									<input id="payment" name="payment" class="form-control" type="number">
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-3 control-label">面值:</label>
								<div class="col-sm-8">
									<input id="price" name="price" class="form-control" type="number">
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-3 control-label">赠送金额:</label>
								<div class="col-sm-8">
									<input id="giveprice" name="giveprice" class="form-control" type="number">
								</div>
							</div>
							
								
							<div class="form-group">
								<label class="col-sm-3 control-label">类型:</label>
								<div class="col-sm-8">
									<select id="type" data-placeholder="类型" name="type"
								              class="form-control chosen-select" tabindex="2">
										<option value="" selected>类型</option>
										<option value="1">直接充值</option>
										<option value="2">分期</option>
										<option value="3">赠送金额分期</option>
							</select>
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-3 control-label">分几个月返回:</label>
								<div class="col-sm-8">
									<input id="totaltime" name="totaltime" class="form-control" type="number">
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-3 control-label">每个月返回金额:</label>
								<div class="col-sm-8">
									<input id="monthlyMoney" name="monthlyMoney" class="form-control" type="number">
								</div>
							</div>
							
							<input type="hidden" id="centreId"  name="centreId" th:value="${centreId}" th:if="${flag} == '1'">
							<div class="form-group" th:if="${flag} == '0'">
							<label class="col-sm-3 control-label">选择商户:</label>
							<div class="col-sm-8">
							<select data-placeholder="商户" class="form-control chosen-select" id="centreId"  
							           name="centreId" tabindex="2">
								<option value="">选择商户</option>
								<option th:each="item: ${centreList}" th:text="${item.name}" th:value="${item.centreId}"></option>
							</select>
							</div>
						</div>
							
							<div class="form-group">
								<label class="col-sm-3 control-label">每个月什么时候返金额:</label>
								<div class="col-sm-8">
									<div class="col-sm-4 col-xs-6">
										<input type="text" name="monthly" id="monthly"
											   placeholder="请选择日期时间"
											   readonly="readonly" class="layui-input form-control"
											   style="padding-left: 12px;">
									</div>
								</div>
							</div>
							
								<div class="form-group">
								<label class="col-sm-3 control-label">上下架日期:</label>
								<div class="col-sm-8">
									<div class="col-sm-4 col-xs-6">
										<input type="text" name="startTime" id="startTime"
											   placeholder="请选择日期时间"
											   readonly="readonly" class="layui-input form-control"
											   style="padding-left: 12px;">
									</div>
									<div class="col-sm-4 col-xs-6">
										<input type="text" name="endTime" id="endTime"
											   placeholder="请选择日期时间"
											   readonly="readonly" class="layui-input form-control"
											   style="padding-left: 12px;">
									</div>
								</div>
							</div>
							
						  <div class="form-group">
								<label class="col-sm-3 control-label">用户最多购买多少次:</label>
								<div class="col-sm-8">
									<input id="num" name="num" class="form-control" type="number">
								</div>
							</div>
							
                          <div class="form-group">
								<label class="col-sm-3 control-label">详情:</label>
								<div class="col-sm-8">
									<input  type="text" id="details"  class="form-control" 
									      name="details"/>
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-3 control-label">是否显示:</label>
								<div class="col-sm-8">
									<select id="type" data-placeholder="类型" name="type"
								              class="form-control chosen-select" tabindex="2">
										<option value="0">显示</option>
										<option value="1">不显示</option>
							        </select>
								</div>
							</div>

							<div class="form-group text-center">
								<div class="col-sm-8 col-sm-offset-2">
									<button type="submit" class="btn btn-primary"><i class="fa fa-check"></i>提交</button>
									<div class="btn btn-danger" onclick="closeDow()"><i class="fa fa-remove"></i> 关闭</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div th:include="mall/advert/include::footer"></div>
	<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/js/bootstrap-select.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/js/i18n/defaults-*.min.js"></script>
	<script type="text/javascript" src="/js/appjs/promotion/shipcard/add.js"></script>
	<script type="text/javascript" src="/js/plugins/layui/layui.js"></script>
	<script type="text/javascript">
		function closeDow() {
			var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
			parent.layer.close(index);
		}
		
		 layui.use('laydate', function(){
	            var laydate = layui.laydate;
	            laydate.render({
	                elem: '#monthly'
	                ,type: 'datetime'
	            });

	            laydate.render({
	                elem: '#startTime' , type: 'datetime'
	            });

	            laydate.render({
	                elem: '#endTime' , type: 'datetime'
	            });
	        })
	</script>
</body>

</html>
